<?php

class PlanAction extends Action {
    
    private $smarty;
    private $em;

    function __construct($smarty, $em) {
        $this->smarty = $smarty;
        $this->em = $em;
    }
    
    public function escolher(){
        require_once './Service/PlanService.php';
        require_once './Model/Plan.php';
        $planService = new PlanService($this->em);
        $planList = $planService->findAll("Plan");
        $this->smarty->assign("plans", $planList);
        $this->smarty->display("plan/plan.tpl"); 
    }
    
}
